{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">域名管理</li>
            {if condition="$admin_id eq 1"}<li class=""><a href="{:url('admin/domain/add')}">添加域名</a></li>{/if}
        </ul>
        <div class="layui-tab-content">
            <hr>

            <form action="" method="post" class="ajax-form">
                <div class="layui-tab-item layui-show">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th style="width: 15px;"><input type="checkbox" class="check-all"></th>
                            <th style="width: 30px;">ID</th>
                            <th>域名</th>
                            <th>备注</th>
                            <th>添加时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {foreach name="domain_list" item="vo"}
                        <tr>
                            <td><input type="checkbox" name="ids[]" value="{$vo.id}"></td>
                            <td>{$vo.id}</td>
                            <td>{$vo.domain}</td>
                            <td>{$vo.remark}</td>
                            <td>{$vo.create_time}</td>
                            <td>
                                <span class="layui-btn layui-btn-normal layui-btn-mini" onclick="select_link({$vo.id});">生成代码</span>                            
                                <a class="layui-btn layui-btn-normal layui-btn-mini" href="{:url('admin/order/index',['cid'=>$vo['id']])}">查看详情</a>
                                {if condition="$admin_id eq 1"}<a href="{:url('admin/domain/edit',['id'=>$vo['id']])}" class="layui-btn layui-btn-normal layui-btn-mini">编辑</a>
                                <a href="{:url('admin/domain/delete',['id'=>$vo['id']])}" class="layui-btn layui-btn-danger layui-btn-mini ajax-delete">删除</a>
                                <a href="javascript:;" onclick="author_user({$vo.id});"; class="layui-btn layui-btn-warm layui-btn-mini">域名授权</a>
                                {/if}
                            </td>
                        </tr>
                        {/foreach}
                        </tbody>
                    </table>
                    <!--分页-->
                    {$domain_list->render()}
                </div>
            </form>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    function select_link(cid){
        layer.open({
          title: '生成代码'
          ,area:'500px'
          ,content: '{$url}'+cid
        });  
    }
</script>
<script>{$js_template}</script>
{/block}